<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<form action="${basePath }/customer/list" method="post" id="moveSearchForm" style="margin: 10px 0 0 0;">
  <ul class="nav nav-pills">
    <li style="float: right;"><a href="javascript:moveSearchForm.reset();">重置</a></li>
    <li style="float: right;"><a href="javascript:moveList(1);">查询</a></li>
    <li style="float: right;"><input id="keyword" name="keyword" type="text" style="margin: 2px 10px 0 0;" placeholder="模糊查询户号、户名" title="模糊查询户号、户名" /></li>
  </ul>
  <input name="pageNum" type="hidden" value="${page.current }" />
  <input name="oldSeqId" type="hidden" value="${oldSeqId}" />
</form>

<table class="table table-hover" id="moveTable">
  <thead>
    <tr class="success">
      <th width="200px">户号</th>
      <th width="200px">户名</th>
      <th>详细地址</th>
      <th width="150px">操作</th>
    </tr>
  </thead>
  <tbody id="contentTBody">
	<c:choose>
	<c:when test="${page.records.size() > 0}">
	<c:forEach items="${page.records}" var="c" varStatus="status">
		<tr>
			<td>${c.customerNumber}</td>
			<td>${c.customerName}</td>
			<td>${c.address}</td>
			<td>
				<c:choose>
					<c:when test="${oldSeqId eq c.seqId}">
						<div class="btn-group">
							<button class="btn btn-warn">当前户号</button>
						</div>
					</c:when>
					<c:otherwise>
						<div class="btn-group">
							<button class="btn btn-success" onclick="moveData('${oldSeqId }','${c.seqId}');">移动到该户号下</button>
						</div>
					</c:otherwise>
				</c:choose>
			</td>
		</tr>
	</c:forEach>
	</c:when>
	<c:otherwise>
		<tr><td colspan="4">暂无数据</td></tr>
	</c:otherwise>
	</c:choose>
  </tbody>
</table>

<script>
	var moveCurrent = ${page.current};
	var movePages = ${page.pages};
	var moveTotal = ${page.total};
	var movePageSize = ${page.size};
	var oldSeqId = '${oldSeqId}';
	
	createMovePage(moveCurrent,movePages);
	moveSearchForm.keyword.value = '${keyword}';
</script>